#include <stdio.h>
main()
{	 	  	  	   
    int a[5][5];
		
    int i,j,sum; 	

    printf("Input a 5*5 matrix\n");
    for(i=0;i<=4;i++)                      //1
    {	 	  	  	   
        for(j=0;j<=4;j++)                  //1
             scanf("%d",&a[i][j]);//2
    }  
    sum=0; //2
    for(i=0;i<=4;i++)                      //1
    {	 	  	  	   
        for(j=0;j<=4;j++)                  //1
             if(i==j || i+j==4)            //2
                 sum=sum+a[i][j];          //2
    }
    printf("sum=%5d\n",sum);               //2
}